'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
	//event为客户端上传的参数
	var type = event.type;
	var info = event.info || "";
	if (type == 'phone') {
		return await db.collection('jubao').where({
			phone: info
		}).get()
	} else if (type == 'wx') {
		return await db.collection('jubao').where({
			wx: info
		}).get()
	} else if(type == 'zfb') {
		return await db.collection('jubao').where({
			zfb: info
		}).get()
	}else{
		return await db.collection('jubao').where({
			_id: event._id
		}).get()
	}
};
